#ifndef __SHUTDOWN_H__
#define __SHUTDOWN_H__


#include <unistd.h>
#include <pthread.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <string.h>
#include <stdlib.h>
#include <poll.h>
#include <signal.h>
#include <sys/time.h>
#include <semaphore.h>


#define SYSFS_LED_EXPORT			"/sys/class/gpio/export"
#define SYSFS_LED_EXPORT_VAL		"30"
#define SYSFS_LED_DIR				"/sys/class/gpio/gpio30/direction"
#define SYSFS_LED_DIR_VAL			"in"
#define SYSFS_LED_VAL				"/sys/class/gpio/gpio30/value"
#define SYSFS_LED_EDGE				"/sys/class/gpio/gpio30/edge"
#define SYSFS_LED_EDGE_VAL			"rising"

void* start_receive_gpio_rising_thread(void *args);

class rotate_speed_c
{
public:
	rotate_speed_c();
	~rotate_speed_c();
	
	int setup(void);
	void exit(void);
	int init_gpio(int *fd);
	void receive_gpio_rising_thread_func(void);

	int gpio_fd;
	struct pollfd fds[1];
	struct itimerval it;
	int rising_count;
	pthread_t speed_test_tid;
};

#endif

